-- @owner: @wan005
-- @date: 2022/09/16
-- @testpoint: 在自定义函数中包含四种UNSIGNED数据类型
-- @modified by z@wan005,2023.06.07，类型转换规则变更，修改结果
--step1:创建包含UNSIGNED数据类型的函数; expect:创建函数成功
drop function if exists func_unsigned_13;
create function func_unsigned_13(in uint1,
out f1 uint1, out f2 uint2, out f3 uint4, out f4 uint8)
as $$
select $1, cast($1 as uint2), cast($1 as uint4), cast($1 as uint8)
$$
language sql;
/
--step2:调用函数; expect:调用成功
select func_unsigned_13(0.5);
select func_unsigned_13('0.5');
--step3:清理环境; expect:清理成功
drop function if exists func_unsigned_13;
